package com.yss.netty.config;

import com.yss.netty.util.Constants;

public class NettyClientConfig {

    /**
     * Whether tcp delay
     */
    private boolean tcpNoDelay = true;

    /**
     * Send buffer size
     */
    private int sendBufferSize = 65535;

    /**
     * Receive buffer size
     */
    private int receiveBufferSize = 65535;

    /**
     * connect timeout millis
     */
    private int connectTimeoutMillis = 3000;

    private int workerThreadNum = Constants.CPUS;

    public static final boolean SO_KEEPALIVE = true;

    public boolean isTcpNoDelay() {
        return tcpNoDelay;
    }

    public void setTcpNoDelay(boolean tcpNoDelay) {
        this.tcpNoDelay = tcpNoDelay;
    }

    public int getSendBufferSize() {
        return sendBufferSize;
    }

    public void setSendBufferSize(int sendBufferSize) {
        this.sendBufferSize = sendBufferSize;
    }

    public int getReceiveBufferSize() {
        return receiveBufferSize;
    }

    public void setReceiveBufferSize(int receiveBufferSize) {
        this.receiveBufferSize = receiveBufferSize;
    }

    public int getConnectTimeoutMillis() {
        return connectTimeoutMillis;
    }

    public void setConnectTimeoutMillis(int connectTimeoutMillis) {
        this.connectTimeoutMillis = connectTimeoutMillis;
    }

    public int getWorkerThreadNum() {
        return workerThreadNum;
    }

    public void setWorkerThreadNum(int workerThreadNum) {
        this.workerThreadNum = workerThreadNum;
    }
}
